package net.phoenix.repository.nodetype;

import java.util.Comparator;

import javax.jcr.nodetype.PropertyDefinition;

/**
 * 
 * Jigsaw server
 * 
 * @author <a href="shamphone@gmail.com">Li XiongFeng</a>
 * @date 2012-1-4
 * @version 1.0.0
 */
public class PropertyDefinitionComparator implements Comparator<PropertyDefinition> {

	/**
	 * Compares its two arguments for order.
	 * 
	 * @param o1
	 *            the first object to be compared.
	 * @param o2
	 *            the second object to be compared.
	 * @return a negative integer, zero, or a positive integer as the first
	 *         argument is less than, equal to, or greater than the second.
	 */
	public int compare(PropertyDefinition def1, PropertyDefinition def2) {

		return def1.getName().compareTo(def2.getName());

	}
}
